package com.sk.bilibili.view.fragment.main;

import com.sk.bilibili.adapter.pager.main.CollectFragmentAdapter;
import com.sk.bilibili.databinding.FragmentCollectBinding;
import com.sk.bilibili.databinding.FragmentSaveBinding;
import com.sk.bilibili.event.MainMenuEvent;
import com.sk.bilibili.model.fragment.main.CollectModel;
import com.sk.bilibili.model.fragment.main.SaveModel;
import com.sk.bilibili.view.activity.SearchActivity;
import com.sk.bilibili.view.fragment.BaseFragment;

import org.greenrobot.eventbus.EventBus;

public class CollectFragment extends BaseFragment<FragmentCollectBinding, CollectModel>{

    @Override
    protected void afterSetView() {
        initView();
        bindEvent();
    }

    private void initView() {
        bind.vpShow.setAdapter(new CollectFragmentAdapter(getChildFragmentManager()));
        bind.tlShow.setupWithViewPager(bind.vpShow);
        bind.ivSearch.setOnClickListener(v-> SearchActivity.start(getContext(),null));
    }

    private void bindEvent() {
        bind.ivMenu.setOnClickListener(v -> EventBus.getDefault().post(MainMenuEvent.closeEvent()));
    }

}